package com.qf.controller;

import com.qf.service.EmplyeeService;
import com.qf.utils.MessageUtil;
import com.qf.utils.RedisUtil;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/message")
public class MessageController {


    @Resource
    private MessageUtil messageUtil;

    @RequestMapping("/send/{tel}")
    public String sendMessage(@PathVariable String tel){
        try {
            messageUtil.sendMessage(tel);
            return "success";
        } catch (Exception e) {
            e.printStackTrace();
            return "fail";
        }
    }

    @RequestMapping("/sun")
    public void sendSun(){
        System.out.println("ok");
    }
}
